//
//  ViewController.m
//  29-TransitionAnimation
//
//  Created by dllo on 16/8/23.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "ViewController.h"
#import "PushTransitionAnimation.h"
#import "PopTransitionAnimation.h"
@interface ViewController ()<UINavigationControllerDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.delegate = self;
    
}
- (nullable id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
                                            animationControllerForOperation:(UINavigationControllerOperation)operation
                                                         fromViewController:(UIViewController *)fromVC
                                                           toViewController:(UIViewController *)toVC {
    
    if (operation == UINavigationControllerOperationPush) {
        PushTransitionAnimation *push = [[PushTransitionAnimation alloc] init];
        return push;
    } else if (operation == UINavigationControllerOperationPop) {
        PopTransitionAnimation *pop = [[PopTransitionAnimation alloc] init];
        return pop;
    } else {
        
    }
    return nil;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
